package io.seata.order.web;

import io.seata.common.dto.OrderDTO;
import io.seata.common.response.ObjectResponse;
import io.seata.order.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @author ZengRJ
 */
@RestController
@RequestMapping("order")
public class OrderController {

    @Resource
    private OrderService orderService;

    public OrderController(OrderService orderService) {
        this.orderService = orderService;
    }

    @PostMapping("/createOrder")
    public ObjectResponse<OrderDTO> createOrder(@RequestBody OrderDTO orderDTO){
        return orderService.create(orderDTO);
    }
}
